home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / MATHS / RLAB / RLAB125.ZIP / !RLaB / help_ai / cumsum < prev    next >
Text File  |  1995-02-18  |  714b  |  30 lines

  1. cumsum:
  2.  
  3. Syntax:    cumsum ( A )
  4.  
  5. Description:
  6.  
  7.     cumsum computes the running, or cumulative sum of a vector or
  8.     matrix. The return object is a matrix the same size as the
  9.     input, A. If A is a rectangular matrix, then the cumulative
  10.     sums are performed over the columns of the matrix.
  11.  
  12. Example:
  13.  
  14.         > a = 1:4
  15.          a =
  16.                 1          2          3          4  
  17.         > cumsum(a)
  18.                 1          3          6         10  
  19.         > a= [1,2,3;4,5,6;7,8,9]
  20.          a =
  21.                 1          2          3  
  22.                 4          5          6  
  23.                 7          8          9  
  24.         > cumsum (a)
  25.                 1          2          3  
  26.                 5          7          9  
  27.                12         15         18  
  28.  
  29. See Also: cumprod, prod, sum
  30.